package com.dreamthen.dao.impl;

import com.dreamthen.dao.IUserDao;
import com.dreamthen.entity.User;
import org.springframework.stereotype.Repository;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author zengms
 * @Date 2023-10-29 09:08:54
 **/
@Repository
public class UserDaoImpl implements IUserDao {
    @Override
    public User getUser(String id) throws Exception {
        User user = new User();
        if(null == id){
            throw new Exception("id不能空");
        }
        user.setId("1");
        user.setName("张三");
        return user;
    }

    @Override
    public void delUser(String id) {
        System.out.println("****dao-delUser****");
    }

    @Override
    public List<User> query() {
        User user = new User();
        user.setId("4");
        user.setName("李四");
        List<User> list = new ArrayList<>();
        list.add(user);
        return list;
    }
}
